<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<script src="../static/js/kit.js"></script>
		<!--[if IE]>
		<script src="../static/js/ieFix.js"></script>
		<![endif]-->
		<script type="text/javascript">
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-30210234-1']);
			_gaq.push(['_trackPageview']);
			(function() {
				var ga = document.createElement('script');
				ga.type = 'text/javascript';
				ga.async = true;
				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
				var s = document.getElementsByTagName('script')[0];
				s.parentNode.insertBefore(ga, s);
			})();

		</script>
		<script src="../static/js/dom.js"></script>
		<script src="../static/js/form.js"></script>
		<link rel="stylesheet" href="../static/css/css.css" />
		<link rel="stylesheet" href="../static/css/login.css" />
		<link rel="stylesheet" href="../static/css/validator.css" />
		<!--validator-->
		<script src="../static/js/validator.js"></script>
		<script src="../static/js/autowired.validator.js"></script>
		<style>
			table td {
				font-size: 14px;
			}
			label {
				cursor: pointer;
				margin-right: 1em;
			}
		</style>
	</head>
	<body>
		<h1>用户注册</h1>
		<div id="regist-main">
			<form id="registForm" action="/Account/Register" method="post" onsubmit="alert('验证通过，可以提交！');return false;">
				<ol>
					<li>
						<label for="UserName">用户名：
						<span class="kitjs-validator" for="@UserName" rules="[{notNull:true, message:'用户名不能为空'}]"></span>
						</label>
						<span class="field-validation-valid" data-valmsg-for="UserName" data-valmsg-replace="true"></span>
						<input id="UserName" name="UserName" type="text" value="">
					</li>
					<li>
						<label for="nikeName">昵称：
						<span class="kitjs-validator" for="@nikeName" rules="[{notNull:true, message:'昵称不能为空'},{isEmail:true,message:'昵称格式不正确'}]"></span>
						</label>
						<span class="field-validation-valid" data-valmsg-for="nikeName" data-valmsg-replace="true"></span>
						<input id="nikeName" name="nikeName" type="text" value="">
					</li>
					<li>
						<label for="sex">性别：
						<span class="kitjs-validator" for="@sex" rules="[{notNull:true, message:'性别不能为空'},{isEmail:true,message:'性别格式不正确'}]"></span>
						</label>
						<span class="field-validation-valid" data-valmsg-for="sex" data-valmsg-replace="true"></span>
						<input id="sex" name="sex" type="text" value="">
					</li>

					<li>
						<label for="Password">密码：
						<span class="kitjs-validator" for="@Password" rules="[{notNull:true, message:'密码不能为空'},{minLength:'6',message:'密码长度最少为6位'}]"></span>
						</label>
						<span class="field-validation-valid" data-valmsg-for="Password" data-valmsg-replace="true"></span>
						<input id="Password" name="Password" type="password">
					</li>
					<li>
						<label for="ConfirmPassword">重新输入密码：
						<span class="kitjs-validator" for="@ConfirmPassword" rules="[{notNull:true, message:'重新输入密码不能为空'},{equalWith:'@Password',message:'两次输入密码必须一致'},{minLength:'6',message:'密码长度最少为6位'}]"></span>
						</label>
						<span class="field-validation-valid" data-valmsg-for="ConfirmPassword" data-valmsg-replace="true"></span>
						<input id="ConfirmPassword" name="ConfirmPassword" type="password">
					</li>
				</ol>
				<div class="registError"></div>
				<input type="submit" onclick="doSave()" value="注册" class="btn-submit">
			</form>
		</div>
		<script type="text/javascript">
			function doSave(){
				//1.获取表单数据
				var params=doGetEditFormData();
				//2.发起异步请求
				var url="user/doSave";;
				console.log(params);
				$.post(url,params,function(result){
					if(result.status==200){
						alert(result.msg);
					}else{
						alert(result.msg);
					}
				})
			}
			function doGetEditFormData(){
				//获取用户输入的数据
				var params={
					username:$("#UserName").val(),
					password:$("#Password").val(),
					nikeName:$("#nikeName").val(),
					sex:$("#sex").val(),



				}

				return params;
			}

		</script>
<!--  <p align="center">适用浏览器：IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. </p>-->
<!--   <p align="center">来源：<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>-->
	</body>
</html>